#ifndef _AI_H_
#define _AI_H_

#include <stdio.h>
#include <string.h>
#include <iostream>
#include <string>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <list>
#include <iterator>
#include <algorithm>
#include <ctime>
#include <sstream>


#include "SimpleMinipar.h"
#include "wn.h"

using namespace std;

const string TYPE_DIR = "TXT/type.txt";
const string PER_DIR = "TXT/person.txt";
const string EXC_DIR = "TXT/exception.txt";
const string OTG_DIR = "TXT/ontology.txt";
const string VRB_DIR = "TXT/verb.txt";
const string DOM_DIR = "TXT/domain.txt";
const string NUM_DIR = "TXT/number.txt";
const string PRN_DIR = "TXT/pronoun.txt";
const string DAY_DIR = "TXT/weekday.txt";
const string OUT_DIR = "output.txt";

const int INPUT_LENGTH = 512;
const int DEPENDENCE_LENGTH = 80;
const int POS_LENGTH = 80;
const int TYPE_LENGTH = 80;
const int DOMAIN_LENGTH = 80;
const int DETAIL_LENGTH = 80;

const int NULL_FLAG = 0;
const int QNA_FLAG = 1;
const int COMMAND_FLAG = 2;

struct ExceptionInfo
{
	string pos;
	string type;
};

struct WordInfo
{
	string word;
	string pos;
	string dependence;
	string type;
};

struct SlotInfo
{
	string slotName;
	string tag;
};

struct DomainInfo
{
	unsigned long long int bit;
	string domain;
	string detail;
	list<SlotInfo> slot_list;
};

struct OntologyInfo
{
	string tag;
	list<string> ontology_word_list;

	~OntologyInfo()
	{
		ontology_word_list.clear();
	}
};

struct AdditionalInfo
{
	string word;
	string type;
};

struct PronounInfo
{
	string word;
	string type;
};

void Init(void);
bool WordnetTag(char* word, char* type);
bool PersonTag(char* word);
bool ExceptionTag(char* word, char* pos, char* type);
char* toLowerCase(char* str);
bool VerbSynonyms(char * verb);
bool PhoneNumTag(char * word);
int DeterminePattern(char* domain, char* detail, list<SlotInfo>** slot_list);
int EnglishNum();
bool NumTag(char* word, char* type);
bool TimeTag(char * word, char* type);
bool AdditionalTag();
void PronounTag();
void OntologyTag();

string CalculateTime();

void FillSlots();
void ContentTag(char* str);
void MeasureTag();
string DefaultSlot(const string s);


#endif